home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 25 / CU Amiga Magazine's Super CD-ROM 25 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-08].iso / CUCD / Programming / ixemul / sdk / man / cat4 / tp.0 < prev    next >
Encoding:
Text File  |  1998-06-15  |  21.6 KB  |  397 lines

  1.  
  2. TP(4)                      UNIX Programmer's Manual                      TP(4)
  3.  
  4. NNAAMMEE
  5.      TTPP - ISO Transport Protocol
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ##iinncclluuddee <<ssyyss//ssoocckkeett..hh>>
  9.      ##iinncclluuddee <<nneettiissoo//iissoo__eerrrrnnoo..hh>>
  10.      ##iinncclluuddee <<nneettiissoo//ttpp__ppaarraamm..hh>>
  11.      ##iinncclluuddee <<nneettiissoo//ttpp__uusseerr..hh>>
  12.  
  13.      _i_n_t
  14.      ssoocckkeett(_[_A_F___I_N_E_T_, _A_F___I_S_O_], _S_O_C_K___S_E_Q_P_A_C_K_E_T, _0)
  15.  
  16. DDEESSCCRRIIPPTTIIOONN
  17.      The TP protocol provides reliable, flow-controlled, two-way transmission
  18.      of data and record boundaries.  It is a byte-stream protocol and is ac-
  19.      cessed according to the SOCK_SEQPACKET abstraction.  The TP protocol
  20.      makes use of a standard ISO address format, including a Network Service
  21.      Access Point, and a Transport Service Entity Selector.  Subclass 4 may
  22.      make use of the internet Internet address format.
  23.  
  24.      Sockets utilizing the tp protocol are either ``active'' or ``passive''.
  25.      Active sockets initiate connections to passive sockets.  By default TCP
  26.      sockets are created active; to create a passive socket the listen(2) sys-
  27.      tem call must be used after binding the socket with the bind(2) system
  28.      call.  Only passive sockets may use the accept(2) call to accept incoming
  29.      connections.  Only active sockets may use the connect(2) call to initiate
  30.      connections.
  31.  
  32.      Passive sockets may ``underspecify'' their location to match incoming
  33.      connection requests from multiple networks.  This technique, termed
  34.      ``wildcard addressing'', allows a single server to provide service to
  35.      clients on multiple networks.  To create a socket which listens on all
  36.      networks, the NSAP portion of the bound address must be void (of length
  37.      zero).  The Transport Selector may still be specified at this time; if
  38.      the port is not specified the system will assign one.  Once a connection
  39.      has been established the socket's address is fixed by the peer entity's
  40.      location.   The address assigned the socket is the address associated
  41.      with the network interface through which packets are being transmitted
  42.      and received.
  43.  
  44.      The ISO Transport Protocol implemented for AOS R2 at the University of
  45.      Wisconsin - Madison, and modified for inclusion in the Berkeley Software
  46.      Distribution, includes classes 0 and 4 of the ISO transport protocols as
  47.      specified in the June 1986 version of IS 8073.  Class 4 of the protocol
  48.      provides reliable, sequenced, flow-controlled, two-way transmission of
  49.      data packets with an alternate stop-and-wait data path called the "expe-
  50.      dited data" service.  Class 0 is essentially a null transport protocol,
  51.      which is used when the underlying network service provides reliable, se-
  52.      quenced, flow-controlled, two-way data transmission.  Class 0 does not
  53.      provide the expedited data service.  The protocols are implemented as a
  54.      single transport layer entity that coexists with the Internet protocol
  55.      suite.  Class 0 may be used only in the ISO domain.  Class 4 may be used
  56.      in the Internet domain as well as in the ISO domain.
  57.  
  58.      Two system calls were modified from the previous release of the Berkeley
  59.      Software Distribution to permit the support of the end-of-transport-ser-
  60.      vice-data-unit (EOTSDU) indication, and for the receipt and transmission
  61.      of user connect, confirm, and disconnect data.  See sendmsg(2) and
  62.      recvmsg(2),  and further discussion below for the formats of the data in
  63.      the ancillary data buffer.  If the EOTSDU is not needed, the normal
  64.      read(2),  and write(2) system calls may be used.
  65.  
  66.  
  67.      Through the getsockopt and setsockopt system calls, TP supports several
  68.      options to control such things as negotiable options in the protocol and
  69.      protocol strategies.  The options are defined in <_n_e_t_i_s_o_/_t_p___u_s_e_r_._h>, and
  70.      are described below.
  71.  
  72.      In the tables below, the options marked with a pound sign `#' may be used
  73.      with setsockopt after a connection is established.  Others must be used
  74.      before the connection is established, in other words, before calling con-
  75.      nect or accept.  All options may be used with getsockopt before or after
  76.      a connection is established.
  77.  
  78.      TPOPT_CONN_DATA    (char *) [none]
  79.                         Data to send on connect.  The passive user may issue a
  80.                         getsockopt call to retrieve a connection request's us-
  81.                         er data, after having done the accept system call
  82.                         without implying confirmation of the connection.
  83.  
  84.                         The data may also be retrieved by issuing a recvmsg
  85.                         request for ancillary data only, without implying con-
  86.                         firmation of the connection.  The returned _c_m_s_g_h_d_r
  87.                         will contain SOL_TRANSPORT for the _c_s_m_g___l_e_v_e_l and
  88.                         TPOPT_CONN_DATA for _c_m_s_g___t_y_p_e_.
  89.  
  90.      TPOPT_DISC_DATA #  (char *) [none]
  91.                         Data to send on close.  Disconnect data may be sent by
  92.                         the side initiating the close but not by the passive
  93.                         side ("passive" with respect to the closing of the
  94.                         connection), so there is no need to read disconnect
  95.                         data after calling close.  This may be sent by a set-
  96.                         sockopt system call, or by issuing a sendmsg request
  97.                         specifying ancillary data only.  The user-provided
  98.                         _c_m_s_g_h_d_r must contain SOL_TRANSPORT for _c_s_m_g___l_e_v_e_l and
  99.                         TPOPT_DISC_DATA for _c_m_s_g___t_y_p_e. Sending of disconnect
  100.                         data will in of itself tear down (or reject) the con-
  101.                         nection.
  102.  
  103.      TPOPT_CFRM_DATA #  (char *) [none]
  104.                         Data to send when confirming a connection.  This may
  105.                         also be sent by a setsockopt system call, or by issu-
  106.                         ing a sendmsg request, as above.  Sending of connect
  107.                         confirm data will cause the connection to be confirmed
  108.                         rather than rejected.
  109.  
  110.      TPOPT_PERF_MEAS #  Boolean.
  111.                         When true,  performance measurements will be kept for
  112.                         this connection.  When set before a connection is es-
  113.                         tablished, the active side will use a locally defined
  114.                         parameter on the connect request packet; if the peer
  115.                         is another ARGO implementation, this will cause per-
  116.                         formance measurement to be turned on on the passive
  117.                         side as well.  See tpperf(8).
  118.  
  119.      TPOPT_PSTATISTICS  No associated value on input.  On output, _s_t_r_u_c_t
  120.                         _t_p___p_m_e_a_s.
  121.  
  122.                         This command is used to read the performance statis-
  123.                         tics accumulated during a connection's lifetime.  It
  124.                         can only be used with getsockopt.  The structure it
  125.                         returns is described in <_n_e_t_i_s_o_/_t_p___s_t_a_t_._h>. See
  126.                         tpperf(8).
  127.  
  128.      TPOPT_FLAGS        unsigned integer. [0x0]
  129.                         This command can only be used with getsockopt.  See
  130.  
  131.  
  132.                         the description of the flags below.
  133.  
  134.      TPOPT_PARAMS       _s_t_r_u_c_t _t_p___c_o_n_n___p_a_r_a_m
  135.                         Used to get or set a group parameters for a connec-
  136.                         tion.  The _s_t_r_u_c_t _t_p___c_o_n_n___p_a_r_a_m is the argument used
  137.                         with the getsockopt or setsockopt system call.  It is
  138.                         described in <_n_e_t_i_s_o_/_t_p___u_s_e_r_._h>.
  139.  
  140.                         The fields of the _t_p___c_o_n_n___p_a_r_a_m structure are de-
  141.                         scribed below.
  142.  
  143.      _V_a_l_u_e_s _f_o_r _T_P_O_P_T___P_A_R_A_M_S_:
  144.  
  145.      _p___N_r_e_t_r_a_n_s       nonzero short integer [1]
  146.                       Number of times a TPDU will be retransmitted before the
  147.                       local TP entity closes a connection.
  148.  
  149.      _p___d_r___t_i_c_k_s       nonzero short integer [various]
  150.                       Number of clock ticks between retransmissions of discon-
  151.                       nect request TPDUs.
  152.  
  153.      _p___d_t___t_i_c_k_s       nonzero short integer [various]
  154.                       Number of clock ticks between retransmissions of data
  155.                       TPDUs.  This parameter applies only to class 4.
  156.  
  157.      _p___c_r___t_i_c_k_s       nonzero short integer [various]
  158.                       Number of clock ticks between retransmissions of connec-
  159.                       tion request TPDUs.
  160.  
  161.      _p___c_c___t_i_c_k_s       nonzero short integer [various]
  162.                       Number of clock ticks between retransmissions of connec-
  163.                       tion confirm TPDUs.  This parameter applies only to
  164.                       class 4.
  165.  
  166.      _p___x___t_i_c_k_s        nonzero short integer [various]
  167.                       Number of clock ticks between retransmissions of expe-
  168.                       dited data TPDUs.  This parameter applies only to class
  169.                       4.
  170.  
  171.      _p___s_e_n_d_a_c_k___t_i_c_k_s  nonzero short integer [various]
  172.                       Number of clock ticks that the local TP entity will wait
  173.                       before sending an acknowledgment for normal data (not
  174.                       applicable if the acknowledgement strategy is
  175.                       TPACK_EACH). This parameter applies only to class 4.
  176.  
  177.      _p___r_e_f___t_i_c_k_s      nonzero short integer [various]
  178.                       Number of clock ticks for which a reference will be con-
  179.                       sidered frozen after the connection to which it applied
  180.                       is closed.  This parameter applies to classes 4 and 0 in
  181.                       the ARGO implementation, despite the fact that the
  182.                       frozen reference function is required only for class 4.
  183.  
  184.      _p___i_n_a_c_t___t_i_c_k_s    nonzero short integer [various]
  185.                       Number of clock ticks without an incoming packet from
  186.                       the peer after which TP close the connection.  This pa-
  187.                       rameter applies only to class 4.
  188.  
  189.      _p___k_e_e_p_a_l_i_v_e___t_i_c_k_s
  190.                       nonzero short integer [various]
  191.                       Number of clock ticks between acknowledgments that are
  192.                       sent to keep an inactive connection open (to prevent the
  193.                       peer's inactivity control function from closing the con-
  194.                       nection).  This parameter applies only to class 4.
  195.  
  196.      _p___w_i_n_s_i_z_e        short integer between 128 and 16384. [4096 bytes]
  197.                       The buffer space limits in bytes for incoming and outgo-
  198.                       ing data.  There is no way to specify different limits
  199.                       for incoming and outgoing paths.  The actual window size
  200.                       at any time during the lifetime of a connection is a
  201.                       function of the buffer size limit, the negotiated maxi-
  202.                       mum TPDU size, and the rate at which the user program
  203.                       receives data.  This parameter applies only to class 4.
  204.  
  205.      _p___t_p_d_u_s_i_z_e       unsigned char between 0x7 and 0xd.  [0xc for class 4]
  206.                       [0xb for class 0]
  207.                       Log 2 of the maximum TPDU size to be negotiated.  The TP
  208.                       standard (ISO 8473) gives an upper bound of 0xd for
  209.                       class 4 and 0xb for class 0.  The ARGO implementation
  210.                       places upper bounds of 0xc on class 4 and 0xb on class
  211.                       0.
  212.  
  213.      _p___a_c_k___s_t_r_a_t      TPACK_EACH or TPACK_WINDOW. [TPACK_WINDOW]
  214.                       This parameter applies only to class 4.  Two acknowledg-
  215.                       ment strategies are supported:
  216.  
  217.                       TPACK_EACH means that each data TPDU is acknowledged
  218.                       with an AK TPDU.
  219.  
  220.                       TPACK_WINDOW means that upon receipt of the packet that
  221.                       represents the high edge of the last window advertised,
  222.                       an AK TPDU is generated.
  223.  
  224.      _p___r_x___s_t_r_a_t       4 bit mask [TPRX_USE_CW |  TPRX_FASTSTART] over connec-
  225.                       tionless network protocols] [TPRX_USE_CW over connec-
  226.                       tion-oriented network protocols]
  227.                       This parameter applies only to class 4.  The bit mask
  228.                       may include the following values:
  229.  
  230.                       TPRX_EACH: When a retransmission timer expires, retrans-
  231.                       mit each packet in the send window rather than just the
  232.                       first unacknowledged packet.
  233.  
  234.                       TPRX_USE_CW: Use a "congestion window" strategy borrowed
  235.                       from Van Jacobson's congestion window strategy for TCP.
  236.                       The congestion window size is set to one whenever a re-
  237.                       transmission occurs.
  238.  
  239.                       TPRX_FASTSTART: Begin sending the maximum amount of data
  240.                       permitted by the peer (subject to availability).  The
  241.                       alternative is to start sending slowly by pretending the
  242.                       peer's window is smaller than it is, and letting it
  243.                       slowly grow up to the peer window's real size.  This is
  244.                       to smooth the effect of new connections on a congested
  245.                       network by preventing a transport connection from sud-
  246.                       denly overloading the network with a burst of packets.
  247.                       This strategy is also due to Van Jacobson.
  248.  
  249.      _p___c_l_a_s_s          5 bit mask [TP_CLASS_4 |  TP_CLASS_0]
  250.                       Bit mask including one or both of the values TP_CLASS_4
  251.                       and TP_CLASS_0. The higher class indicated is the pre-
  252.                       ferred class.  If only one class is indicated, negotia-
  253.                       tion will not occur during connection establishment.
  254.  
  255.      _p___x_t_d___f_o_r_m_a_t     Boolean.  [false]
  256.                       Boolean indicating that extended format is negotiated.
  257.                       This parameter applies only to class 4.
  258.  
  259.      _p___x_p_d___s_e_r_v_i_c_e    Boolean.  [true]
  260.                       Boolean indicating that the expedited data transport
  261.                       service will be negotiated.  This parameter applies only
  262.  
  263.  
  264.                       to class 4.
  265.  
  266.      _p___u_s_e___c_h_e_c_k_s_u_m   Boolean.  [true]
  267.                       Boolean indicating the the use of checksums will be ne-
  268.                       gotiated.  This parameter applies only to class 4.
  269.  
  270.      _p___u_s_e___n_x_p_d       Reserved for future use.
  271.  
  272.      _p___u_s_e___r_c_c        Reserved for future use.
  273.  
  274.      _p___u_s_e___e_f_c        Reserved for future use.
  275.  
  276.      _p___n_o___d_i_s_c___i_n_d_i_c_a_t_i_o_n_s
  277.                       Boolean.  [false]
  278.  
  279.                       Boolean indicating that the local TP entity will not is-
  280.                       sue indications (signals) when a TP connection is dis-
  281.                       connected.
  282.  
  283.      _p___d_o_n_t___c_h_a_n_g_e___p_a_r_a_m_s
  284.                       Boolean.  [false]
  285.                       If _t_r_u_e the TP entity will not override any of the other
  286.                       values given in this structure.  If the values cannot be
  287.                       used, the TP entity will drop, disconnect, or refuse to
  288.                       establish the connection to which this structure per-
  289.                       tains.
  290.  
  291.      _p___n_e_t_s_e_r_v_i_c_e     One of { ISO_CLNS, ISO_CONS, ISO_COSNS, IN_CLNS }.
  292.                       [ISO_CLNS]
  293.                       Indicates which network service is to be used.
  294.  
  295.                       ISO_CLNS indicates the connectionless network service
  296.                       provided by CLNP (ISO 8473).
  297.  
  298.                       ISO_CONS indicates the connection-oriented network ser-
  299.                       vice provided by X.25 (ISO 8208) and ISO 8878.
  300.  
  301.                       ISO_COSNS indicates the connectionless network service
  302.                       running over a connection-oriented subnetwork service:
  303.                       CLNP (ISO 8473) over X.25 (ISO 8208).
  304.  
  305.                       IN_CLNS indicates the DARPA Internet connectionless net-
  306.                       work service provided by IP (RFC 791).
  307.  
  308.      _p___d_u_m_m_y          Reserved for future use.
  309.  
  310.      The TPOPT_FLAGS option is used for obtaining various boolean-valued op-
  311.      tions.  Its meaning is as follows.  The bit numbering used is that of the
  312.      RT PC, which means that bit 0 is the most significant bit, while bit 8 is
  313.      the least significant bit.
  314.  
  315.      _V_a_l_u_e_s _f_o_r _T_P_O_P_T___F_L_A_G_S_:
  316.  
  317.      BBiittss   DDeessccrriippttiioonn [[DDeeffaauulltt]]
  318.  
  319.      0      TPFLAG_NLQOS_PDN: set when the quality of the network service is
  320.             similar to that of a public data network.
  321.  
  322.      1      TPFLAG_PEER_ON_SAMENET: set when the peer TP entity is considered
  323.             to be on the same network as the local TP entity.
  324.  
  325.      2      Not used.
  326.  
  327.      3      TPFLAG_XPD_PRES: set when expedited data are present [0]
  328.  
  329.      4..7   Reserved.
  330.  
  331. EERRRROORR VVAALLUUEESS
  332.      The TP entity returns _e_r_r_n_o error values as defined in <_s_y_s_/_e_r_r_n_o_._h> and
  333.      <_n_e_t_i_s_o_/_i_s_o___e_r_r_n_o_._h>. User programs may print messages associated with
  334.      these value by using an expanded version of perror found in the ISO li-
  335.      brary, _l_i_b_i_s_o_d_i_r_._a.
  336.  
  337.      If the TP entity encounters asynchronous events that will cause a trans-
  338.      port connection to be closed, such as timing out while retransmitting a
  339.      connect request TPDU, or receiving a DR TPDU, the TP entity issues a
  340.      SIGURG signal, indicating that disconnection has occurred.  If the signal
  341.      is issued during a a system call, the system call may be interrupted, in
  342.      which case the _e_r_r_n_o value upon return from the system call is EINTR. If
  343.      the signal SIGURG is being handled by reading from the socket, and it was
  344.      an accept(2) that timed out, the read may result in ENOTSOCK, because the
  345.      accept call had not yet returned a legitimate socket descriptor when the
  346.      signal was handled.  ETIMEDOUT (or a some other errno value appropriate
  347.      to the type of error) is returned if SIGURG is blocked for the duration
  348.      of the system call.  A user program should take one of the following ap-
  349.      proaches:
  350.  
  351.      Block SIGURG
  352.              If the program is servicing only one connection, it can block or
  353.              ignore SIGURG during connection establishment.  The advantage of
  354.              this is that the _e_r_r_n_o value returned is somewhat meaningful.
  355.              The disadvantage of this is that if ignored, disconnection and
  356.              expedited data indications could be missed.  For some programs
  357.              this is not a problem.
  358.  
  359.      Handle SIGURG
  360.              If the program is servicing more than one connection at a time or
  361.              expedited data may arrive or both, the program may elect to ser-
  362.              vice SIGURG. It can use the ggeettssoocckkoopptt(_._._._T_P_O_P_T___F_L_A_G_S_._._.) system
  363.              call to see if the signal was due to the arrival of expedited da-
  364.              ta or due to a disconnection.  In the latter case, getsockopt
  365.              will return ENOTCONN.
  366.  
  367. SSEEEE AALLSSOO
  368.      tcp(4),  netstat(1),  iso(4),  clnp(4),  cltp(4),  ifconfig(8).
  369.  
  370. BBUUGGSS
  371.      The protocol definition of expedited data is slightly problematic, in a
  372.      way that renders expedited data almost useless, if two or more packets of
  373.      expedited data are send within time epsilon, where epsilon depends on the
  374.      application.  The problem is not of major significance since most appli-
  375.      cations do not use transport expedited data.  The problem is this: the
  376.      expedited data acknowledgment TPDU has no field for conveying credit,
  377.      thus it is not possible for a TP entity to inform its peer that "I re-
  378.      ceived your expedited data but have no room to receive more."  The TP en-
  379.      tity has the choice of acknowledging receipt of the XPD TPDU:
  380.  
  381.      when the user receives the XPD TSDU
  382.              which may be a fairly long time, which may cause the sending TP
  383.              entity to retransmit the packet, and possibly to close the con-
  384.              nection after retransmission, or
  385.  
  386.      when the TP entity receives it
  387.              so the sending entity does not retransmit or close the connec-
  388.              tion.  If the sending user then tries to send more expedited data
  389.              ``soon'', the expedited data will not be acknowledged (until the
  390.              receiving user receives the first XPD TSDU).
  391.  
  392.      The ARGO implementation acknowledges XPD TPDUs immediately, in the hope
  393.      that most users will not use expedited data frequently enough for this to
  394.      be a problem.
  395.  
  396. BSD Experimental                April 19, 1994                               6
  397.